/*
 * @Author: january.cjy
 * @Date: 2021-09-27 19:49:35
 * @Last Modified by: january.cjy
 * @Last Modified time: 2021-09-27 20:58:59
 */
#pragma once

#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/Basic/SourceManager.h"

#include <CmgRecursiveASTVisitor.h>

namespace cmg {

using namespace clang;
using namespace llvm;

class CmgASTConsumer : public clang::ASTConsumer {
public:
  explicit CmgASTConsumer(ASTContext &context, SourceManager &sm,
                          Preprocessor &pp);
  virtual void HandleTranslationUnit(clang::ASTContext &Context);

private:
  ASTContext &ctx;
  SourceManager &sm;
  Preprocessor &pp;
  CmgRecursiveASTVisitor visitor;
};

} // namespace cmg